package valeria;

import java.util.Scanner;

public class J08SungJuk {
	public static void main(String[] args) {
		// 배열을 이용한 성적처리

		// 변수선언
		String name[] = new String[4];
		Scanner sc = new Scanner(System.in);
		String result = "";
		int kor[] = new int[4];
		int eng[] = new int[4];
		int mat[] = new int[4];
		int tot[] = new int[4];
		double[] avg = new double[4];
		String[] grd = new String[4];

		// 입력 및 성적처리
		for (int i = 1; i <= 3; ++i) {
			System.out.println(i + "번째 학생 이름을 입력합니다.");
			System.out.println("이름은?");
			name[i] = sc.next();
			System.out.println("점수는?(국영수)");
			kor[i] = sc.nextInt();
			eng[i] = sc.nextInt();
			mat[i] = sc.nextInt();

			tot[i] = kor[i] + eng[i] + mat[i];
			avg[i] = (double) tot[i] / 3;
			switch ((int) avg[i] / 10) {
			case 10:
			case 9:
				grd[i] = "수";
				break;
			case 8:
				grd[i] = "우";
				break;
			case 7:
				grd[i] = "미";
				break;
			case 6:
				grd[i] = "양";
				break;
			default:
				grd[i] = "가";
			}
			result += name[i] + "\t" + kor[i] + "\t" + eng[i] + "\t" + mat[i]
					+ "\t" + tot[i] + "\t" + avg[i] + "\t" + grd[i] + "\n";

		}
		// 결과출력

		System.out.println(result);
		sc.close();
	}
}
